package com.jt.mapper;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Repository;

@Repository
@PropertySource(value="classpath:/user.properties",encoding = "UTF-8")//加载配置文件
//classpath:/代表resources的根目录
public class UserMapperImpl implements UserMapper{
    //表达式：固定写法Spring表达式 取值方式 缩写spel表达式
    //规则：通过表达式动态获取Spring容器的Value
    @Value("${user.username}")
    private String username;

    @Override
    public void addUser() {
//        username=new String(username.getBytes("ISO-8859-1"),"UTF-8");
        System.out.println("User添加"+username);
    }
}
